<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>乐淘-二级分类</title>
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="./css/common.css">
</head>

<body>
    <!-- 侧边栏 -->
    <div class="aside">
        <div class="brand">
            <a href="index.html">传智播客</a>
        </div>
        <div class="user">
            <img src="./images/dog.jpg" alt="">
            <p>超级管理员</p>
        </div>
        <ul>
            <li>
                <a href="user.html">
                    <span class="glyphicon glyphicon-user"></span>
                    用户管理
                </a>
            </li>
            <li class="category">
                <a href="javascript:;">
                    <span class="glyphicon glyphicon-tasks"></span>
                    分类管理
                </a>
                <div style="display: block">
                    <a href="first.html">一级分类</a>
                    <a href="second.html" class="active">二级分类</a>
                </div>
            </li>
            <li>
                <a href="product.html">
                    <span class="glyphicon glyphicon-tags"></span>
                    商品管理
                </a>
            </li>
        </ul>
    </div>
    <!-- 主体 -->
    <div class="main">
        <div class="topbar">
            <a class="pull-left icon_menu" href="javscript:;"><span class="glyphicon glyphicon-align-justify"></span></a>
            <a class="pull-right icon_logout" href="javscript:;"><span class="glyphicon glyphicon-log-out"></span></a>
        </div>
        <div class="container-fluid">
            <ol class="breadcrumb">
                <li><a href="#">管理系统</a></li>
                <li><a href="#">分类管理</a></li>
                <li class="active">二级分类</li>
            </ol>
            <button class="btn btn-default mb-15 btn-addCategory">添加分类</button>
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th width="10%">序号</th>
                        <th width="30%">一级分类名称</th>
                        <th width="30%">二级分类名称</th>
                        <th width="30%">二级分类LOGO</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- 通过ajax动态生成 -->
                </tbody>
            </table>
            <div class="page_box text-right">
                <ul></ul>
            </div>
        </div>
    </div>

    <!-- 退出登录模态框 -->
    <div class="modal fade" id="logout_model" tabindex="-1">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">温馨提示</h4>
                </div>
                <div class="modal-body">
                    <p class="text-danger">
                        <span class="glyphicon glyphicon-info-sign"></span>
                        您确定要退出后台管理系统吗？
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-logout">退出</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 添加分类模态框 -->
    <div class="modal fade" id="addCategory_model" tabindex="-1">
        <div class="modal-dialog modal-sm">
            <form>
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">添加分类</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <div class="dropdown">
                                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
                                    data-toggle="dropdown">
                                    <span class="first-category-text">请选择一级分类</span>
                                    <span class="caret"></span>
                                </button>
                                <input type="hidden" name="categoryId">
                                <ul class="dropdown-menu">
                                    <!-- 模板动态拉去 -->
                                </ul>
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="text" name="brandName" class="form-control" placeholder="请输入二级分类的名称">
                        </div>
                        <div class="form-group">
                            <label for="pic1" class="btn btn-default">上传图片</label>
                            <!-- 插件使用 -->
                            <input id="pic1" class="hidden" type="file" name="pic1" data-url="/category/addSecondCategoryPic">
                        </div>
                        <div class="form-group">
                            <input type="hidden" name="brandLogo" id="brandLogo">
                            <img src="./images/none.png" id="img-logo" style="width: 100px; height:100px">
                        </div>
                        <input type="hidden" name="hot" value="1">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">添加</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- 二级分类模板 -->
    <script type="text/template" id="tmp">
        {{ each rows v i }}
        <tr>
            <td>{{ (page - 1) * size + i + 1 }}</td>
            <td>{{ v.categoryName }}</td>
            <td>{{ v.brandName }}</td>
            <td>
                <img src="{{ v.brandLogo? v.brandLogo : './images/none.png'  }}" style="width: 50px;height:50px;display:inline-block">
            </td>
        </tr>
        {{ /each }}
    </script>
    <!-- 一级分类模板 -->
    <script type="text/template" id="tmp2">
        {{ each rows v i}}
        <li><a href="javascript:;" data-id="{{ v.id }}">{{ v.categoryName }}</a></li>
        {{ /each }}
    </script>
    <!-- <script src="./lib/jquery/jquery.min.js"></script>
    <script src="./lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/artTemplate/template-web.js"></script>
    <script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/second.js"></script> -->
    <script src="./lib/require/require.js"></script>
    <script src="./js/config.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/second.js"></script>
</body>

</html>